package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.IssuedSocProgAddDTO;
import org.jsola.hr.dto.SocProgAddDTO;
import org.jsola.hr.dto.SocProgBatchDTO;
import org.jsola.hr.dto.SocProgUpdateDTO;
import org.jsola.hr.query.SocProgQuery;
import org.jsola.hr.vo.SocProgListVO;
import org.jsola.hr.vo.SocProgVO;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

/**
 * 参保方案表
 *
 * @author zhr
 */
@Api(tags = "hr-参保方案表")
public interface ISocProgControllerAPI {

    /**
     * 新增参保方案表
     *
     * @param socProgAddDTO 参保方案表新增实体
     * @return 参保方案表展示对象
     */
    @ApiOperation(value = "新增参保方案表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgAddDTO", dataType = "SocProgAddDTO", value = "新增参保方案表", paramType = "body")
    })
    Result<SocProgVO> save(SocProgAddDTO socProgAddDTO);


    /**
     * 修改参保方案表
     *
     * @param socProgUpdateDTO 参保方案表
     * @return 更新数量
     */
    @ApiOperation(value = "修改参保方案表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgUpdateDTO", dataType = "SocProgUpdateDTO", value = "修改参保方案表", paramType = "body")
    })
    Result<Integer> update(SocProgUpdateDTO socProgUpdateDTO);

    /**
     * 批量编辑、新增、删除参保方案表
     *
     * @param socProgBatchDTO 要操作的参保方案表
     * @return 操作之后的全部参保方案表
     */
    @ApiOperation(value = "批量编辑、新增、删除参保方案表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgBatchDTO", dataType = "SocProgBatchDTO", value = "要操作的字段数据", paramType = "body")
    })
    Result batch(SocProgBatchDTO socProgBatchDTO);

    /**
     * 删除单个参保方案表，彻底删除
     *
     * @param socProgId 参保方案表id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个参保方案表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgId", dataType = "String", value = "参保方案表id", paramType = "path")
    })
    Result<Integer> delete(String socProgId);


    /**
     * 批量删除参保方案表，彻底删除
     *
     * @param socProgIds 参保方案表id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除参保方案表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgIds", dataType = "String[]", value = "参保方案表id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] socProgIds);


    /**
     * 根据参保方案表id查询参保方案表详情
     *
     * @param socProgId 参保方案表id
     * @return 参保方案表详情
     */
    @ApiOperation(value = "根据参保方案表id查询参保方案表详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgId", dataType = "String", value = "参保方案表id", paramType = "path")
    })
    Result<SocProgVO> findById(String socProgId);


    /**
     * 查询参保方案表
     *
     * @param socProgQuery 参保方案表查询参数
     * @return page
     */
    @ApiOperation(value = "查询参保方案表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgQuery", dataType = "SocProgQuery", value = "参保方案表查询参数", paramType = "query")
    })
    Result<List<SocProgListVO>> listAll(SocProgQuery socProgQuery);


    /**
     * 查询参保方案表相关
     *
     * @param socProgQuery 参保方案表查询参数
     * @return page
     */
    @ApiOperation(value = "查询参保方案表相关")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgQuery", dataType = "SocProgQuery", value = "参保方案表查询参数", paramType = "query")
    })
    Result<List<SocProgListVO>> listAllRelation(@Valid SocProgQuery socProgQuery);


    /**
     * 分页查询参保方案表
     *
     * @param socProgQuery 参保方案表查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询参保方案表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgQuery", dataType = "SocProgQuery", value = "参保方案表查询参数", paramType = "query")
    })
    Result<Page<SocProgListVO>> page(SocProgQuery socProgQuery);

    /**
     * 分页查询参保方案相关
     *
     * @param socProgQuery 参保方案表查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询参保方案相关")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgQuery", dataType = "SocProgQuery", value = "参保方案表查询参数", paramType = "query")
    })
    Result<Page<SocProgListVO>> pageRelation(SocProgQuery socProgQuery);

    /**
     * 查询参保方案相关
     *
     * @param progId 参保方案表ID
     * @return page
     */
    @ApiOperation(value = "查询参保方案相关")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "progId", dataType = "String", value = "参保方案表ID", paramType = "query")
    })
    Result<SocProgVO> findSocProgRelation(@Valid String progId);

    /**
     * 下发参保方案到公司
     *
     * @param issuedSocProgAddDTO 参保方案
     * @return 参保方案
     */
    @ApiOperation(value = "查询参保方案相关")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "issuedSocProgAddDTO", dataType = "IssuedSocProgAddDTO", value = "参保方案", paramType = "body")
    })
    Result<List<SocProgVO>> saveIssuedSocProg(IssuedSocProgAddDTO issuedSocProgAddDTO);

    /**
     * 根据参保记录的所有子项列表的类型查询拥有这些类型的方案
     *
     * @param empSocInfoId 参保记录Id
     * @param companyId    公司Id
     * @return 参保方案列表
     */
    @ApiOperation(value = "根据参保记录的所有子项列表的类型查询拥有这些类型的方案")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoId", dataType = "String", value = "参保记录Id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<List<String>> selectSchemeByEmpSocInfoId(String empSocInfoId, String companyId);

    /**
     * 根据员工查询这个员工最近一个月使用的参保方案
     * @param empId 员工id
     * @param companyId 公司Id
     * @return 参保方案
     */
    @ApiOperation(value = "根据员工查询这个员工最近一个月使用的参保方案")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<SocProgVO> selectSchemeByEmpRelated(String empId, String companyId);
}

